package com.composite;

/**
 * College的下属部门
 */
public class Department extends OrganizationComponent{

    public Department(String name, String des) {
        super(name, des);
    }

    //对于Department，add和remove方法就不用写了，因为他已经是最小单位了，没有下级部门需要管理了
    @Override
    protected void add(OrganizationComponent organizationComponent) {
        throw new UnsupportedOperationException("Department已为最小单元");
    }

    @Override
    protected void remove(OrganizationComponent organizationComponent) {
        throw new UnsupportedOperationException("Department已为最小单元");
    }

    @Override
    protected void print() {
        System.out.println(getName());
    }
}
